<template>
  <div class="shop">
    <ShopHeader></ShopHeader>
    <div class="tab">
      <div class="tab-item">
        <router-link to="/shop/goods" replace class="order">点菜</router-link>
      </div>
      <div class="tab-item">
        <router-link to="/shop/ratings" replace class="order">评价</router-link>
      </div>
      <div class="tab-item">
        <router-link to="/shop/info" replace class="order">商家</router-link>
      </div>
      <div class="collage">好友拼单</div>
    </div>
    <router-view></router-view>
  </div>
</template>

<script>
import ShopHeader from "../../components/ShopHeader/ShopHeader";
export default {
  data() {
    return {};
  },
  components: {
    ShopHeader,
  },
  created() {
    //底部栏消失
    this.$store.dispatch("footer/footernav", false);
  },
  beforeDestroy() {
    //销毁
    this.$store.dispatch("footer/footernav", true);
  },
};
</script>

<style lang="scss" scoped>
.tab {
  height: 40px;
  line-height: 40px;
  background: #fff;
  border-bottom: 1px solid rgba(7, 17, 27, 0.1);
  position: relative;
  .tab-item {
    float: left;
    width: 15%;
    text-align: center;
    font-size: 14px;
    color: rgb(77, 85, 93);
    .order {
      display: block;
      position: relative;
    }
  }
  .collage {
    position: absolute;
    color: #e4aa70;
    border: 1px solid #e4aa70;
    width: 60px;
    height: 20px;
    right: 12px;
    border-radius: 3px;
    line-height: 20px;
    text-align: center;
    bottom: 8px;
  }
}
.router-link-active {
  color: #000;
  &::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 1px;
    width: 30px;
    height: 2px;
    transform: translateX(-50%);
    background: #ffd161;
  }
}
</style>
